home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / manual-p / vh-man2h.000 / vh-man2h / vh-man2html-1.3 / Makefile next >
Makefile  |  1996-05-04  |  2KB  |  80 lines

  1. #
  2. # man2html
  3. #
  4. # Simple makefile (michael@actrix.gen.nz).
  5. #
  6. # Set these to your desires...
  7. #
  8. # The name of the cwd must be PACKAGENAME in order to build an rpm
  9. #
  10. RPM_PROG = rpm-1.4
  11. PACKAGENAME = vh-man2html-1.3
  12. TARFILE =  $(PACKAGENAME).tar.gz
  13. SPECFILE = $(PACKAGENAME).spec
  14. SPECLOC = /usr/src/SPECS
  15. SOURCELOC = /usr/src/SOURCES
  16. #
  17. # CGIBASE is defined relative to the current server.
  18. # If CGIBASE starts with a relative "http:..." address (ie not "http://.."),
  19. # man2html will insert the httpd's server name (as reported by the 
  20. # SERVER_NAME environment variable) into server any redirects it generates
  21. #  ie a redirect of        location: http:/cgi-bin/...
  22. #     will be returned as  location: http://server_name/cgi-bin/...
  23. # This is so that remote browsers will receive the necessary server 
  24. # address on redirects.
  25. #
  26. CGIBASE = http:/cgi-bin/man2html
  27. #
  28. HTMLDIR = /home/httpd/html
  29. TOPLEVELDOC = $(HTMLDIR)/man.html
  30. #
  31. BINDIR = /usr/bin
  32. CGIDIR = /home/httpd/cgi-bin
  33. MANDIR1 = /usr/man/man1
  34. MANDIR8 = /usr/man/man8
  35. OWNER = root.root
  36. #
  37. # -fno-strength-reduce is in case this gcc has a bug.
  38. CFLAGS = -O2 -fno-strength-reduce -DTOPLEVELDOC='"$(TOPLEVELDOC)"' -DCGIBASE='"$(CGIBASE)"'
  39. INSTALL = install
  40. #
  41. #
  42. INCLUDES =
  43.  
  44. PROGS = man2html manwhatis mansec mansearch
  45.  
  46. targets: $(PROGS)
  47.  
  48. man2html: man2html.c
  49.     $(CC) $(CFLAGS) $< -o $@
  50.  
  51. install: targets
  52.     for i in $(PROGS); do \
  53.       $(INSTALL) $$i $(CGIDIR) ; \
  54.       chown $(OWNER) $(CGIDIR)/$$i ; \
  55.     done ; \
  56.     $(INSTALL) man.html           $(TOPLEVELDOC) ; \
  57.     $(INSTALL) mansearch.html     $(HTMLDIR) ; \
  58.     $(INSTALL) mansearchhelp.html $(HTMLDIR) ; \
  59.     $(INSTALL) netscape-man       $(BINDIR) ; \
  60.     $(INSTALL) man2html.8         $(MANDIR8) ; \
  61.     $(INSTALL) netscape-man.1     $(MANDIR1) ; \
  62.     if [ \! -d /var/man2html ] ; then \
  63.         mkdir /var/man2html ; chmod o=rwxt /var/man2html; \
  64.     fi
  65.  
  66. rpm: spotless
  67.     (cd ..; tar cvzf $(SOURCELOC)/$(TARFILE) $(PACKAGENAME) ) ; \
  68.     cp $(SPECFILE) $(SPECLOC)/$(SPECFILE)
  69.     $(RPM_PROG) -ba -v $(SPECFILE)
  70.  
  71. clean:
  72.     -rm *.o *~
  73.  
  74. spotless: clean
  75.     -rm man2html
  76.  
  77.  
  78.  
  79.  
  80.